16 research outputs found

    Typeful Normalization by Evaluation

    Get PDF
    We present the first typeful implementation of Normalization by Evaluation for the simply typed lambda-calculus with sums and control operators: we guarantee type preservation and eta-long (modulo commuting conversions), beta-normal forms using only Generalized Algebraic Data Types in a general-purpose programming language, here OCaml; and we account for sums and control operators with Continuation-Passing Style. First, we implement the standard NbE algorithm for the implicational fragment in a typeful way that is correct by construction. We then derive its call-by-value continuation-passing counterpart, that maps a lambda-term with sums and call/cc into a CPS term in normal form, which we express in a typed dedicated syntax. Beyond showcasing the expressive power of GADTs, we emphasize that type inference gives a smooth way to re-derive the encodings of the syntax and typing of normal forms in Continuation-Passing Style

    Certificates for Incremental Type Checking

    Get PDF
    The central topic of this thesis is the study of algorithms for type checking, both from the programming language and from the proof-theoretic point of view. A type checking algorithm takes a program or a proof, represented as a syntactical object, and checks its validity with respect to a specification or a statement. It is a central piece of compilers and proof assistants. We postulate that since type checkers are at the interface between proof theory and program theory, their study can let these two fields mutually enrich each other. We argue by two main instances: first, starting from the problem of proof reuse, we develop an incremental type checker; secondly, starting from a type checking program, we evidence a novel correspondence between natural deduction and the sequent calculus

    Towards typed repositories of proofs

    Get PDF
    International audienceIn this paper, we advocate for an architecture for proof assistants and programming language tools that is closer to the daily workflow of their users. Indeed, most of the mathematician or programmer's time is spent editing, not writing. As a consequence, the usual interaction loop "(edit; compile)*; commit" is an over-approximation that does not scale when compilation is replaced by proof-checking. We propose an enhancement and an adaptation of version control paradigms to the management of proof repositories, to witness with more precision the impact of changes. We sketch a dependently typed language that would be a kernel language to build such a framework upon

    Safe Incremental Type Checking

    Get PDF
    2 pagesWe study the problem of verifying the well-typing of terms, not in a batch fashion, as it is usually the case for typed languages, but incrementally, that is by sequentially modifying a term, and re- verifying each time only a smaller amount of information than the whole term, still ensuring that it is well-typed

    Typeful Continuations

    Get PDF
    National audienceContinuation-passing style translations, or CPS, are used notably in compilers. They make a functional program more explicit by sequentializing its computations and reifying its control. They have been used as an intermediate language in many compilers. Yet, we cannot directly use Plotkin's original CPS translation to design compilers, for several reasons: i) the resulting terms it produces are verbose (they contain " administrative redexes " , a well-studied problem) and inefficient (they perform nested beta-reductions sequentially); and ii) their loose syntax can hide possible further optimizations, in particular tail call elimination. These issues have been solved in isolation and on paper, but never combined together and formalized, which i) is necessary to scale to safe, full-featured optimizing compilers and ii) is not a mere juxtaposition of the techniques but requires insight on the design of CPS translations themselves. We propose to design and implement in OCaml a compacting, optimizing CPS translation, while using OCaml's type system to verify that it maps well-typed terms to well-typed terms in a tightly restricted syntactical form (the " typeful " approach to formalization). The resulting artifact can be used directly to design optimizing compilers, and the path towards it offers a tutorial on optimizing CPS translations, and yet another use case for OCaml's advanced type system

    Certificats pour le typage incrémental

    No full text
    La thématique centrale de cette thèse est l'étude des algorithmes de typage, du point de vue des langages de programmation comme du point de vue de la théorie de la preuve. Un algorithme de typage prend en entrée un programme ou une preuve, représenté comme un objet syntaxique, et vérifie sa validité vis-à-vis d'une spécification ou d'un énoncé ; c'est un élément central des compilateurs et des assistants à la preuve. Premièrement, nous présentons un outil d'assistance au développement de programmes fonctionnels manipulant des certificats de preuve (programmes certifiants). Il utilise LF comme métalangage de représentation d'ordre supérieur des preuves et OCaml comme langage de programmation, et facilite la vérification automatique et efficace de ces certificats à l'exécution. Techniquement, nous introduisons en particulier la notion de fonction inverse permettant de s'abstraire d'un environnement local quand on manipule des termes ouverts. Ensuite, nous remarquons que l'idée d'un vérificateur de type certifiant, qui génère une dérivation de typage, peut être étendue pour en faire un vérificateur de type incrémental, fonctionnant par réutilisation de sous-dérivations de typage. Un tel vérificateur de type rendrait possible l'édition structurée et dirigée par le type programmes et de preuves. Enfin, nous mettons en évidence une correspondance originale entre la déduction naturelle et le calcul des séquents, passant par la transformation des programmes fonctionnels de vérification de type correspondants : nous montrons en utilisant des transformations standard que le deuxième est la version par passage d'accumulateur du premier.The central topic of this thesis is the study of algorithms for type checking, both from the programming language and from the proof-theoretic point of view. A type checking algorithm takes a program or a proof, represented as a syntactical object, and checks its validity with respect to a specification or a statement ; it is a central piece of compilers and proof assistants. First, we present a tool which supports the development of functional programs manipulating proof certificates (certifying programs). It uses LF as a representation metalanguage for higher-order proofs and OCaml as a programming language, and facilitates the automated and efficient verification of these certificates at run time. Technically, we introduce in particular the notion of function inverse allowing to abstract from a local environment when manipulating open terms. Then, we remark that the idea of a certifying type checker, generating a typing derivation, can be extended to realize an incremental type checker, working by reuse of typing subderivation. Such a type checker would make possible the structured and type-directed edition of proofs and programs. Finally, we showcase an original correspondence between natural deduction and the sequent calculus, through the transformation of the corresponding type checking functional programs : we show, using off-the-shelf program transformations, that the latter is the accumulator-passing version of the former.PARIS7-Bibliothèque centrale (751132105) / SudocSudocFranceF

    Modélisation des dépôts atmosphériques d’ammoniac dans les territoires à partir de typologies paysagères

    No full text
    Les activités agricoles sont les principales sources d'ammoniac (NH3) émis dans l'atmosphère (706 kton/an, CITEPA, 2016). Les fortes concentrations et les taux élevés de dépôts de NH3 sur le sol et la végétation peuvent avoir un impact sur les écosystèmes sensibles situés à proximité des zones d’émissions. La grande variabilité spatiale des flux de NH3 rend difficile la production de cartes de dépôts de NH3 sur des échelles spatiales larges sans utiliser un grand nombre de mesures ou des modèles à haute résolution spatiale. Les impacts environnementaux des flux de NH3 sur les écosystèmes peuvent varier selon le modèle de dispersion, de transfert et de dépôt utilisé. Nous avons comparé un modèle (OPS-ST, Sauter et al., 2015) permettant de simuler les pertes de NH3 à l’échelle locale (paysage de quelques km2 représenté par des mailles de quelques dizaines de mètres de côté) avec un modèle (CHIMERE, Menut et al., 2014) fonctionnant à l'échelle régionale (paysage de quelques milliers de km2 représenté par des mailles de quelques kilomètres de côté). Deux cas d’étude ont été construits pour comparer le comportement des deux modèles : le premier cas était complétement théorique et idéalisé et le second était adapté des typologies paysagères établies sur l’un des territoires mobilisés dans le projet ESCAPADE, le Blavet (2029 km2) en Bretagne, caractérisé par des élevages intensifs (Lazrak et al., 2014). Des scénarios ont été créés pour ces deux cas d’étude en modifiant la résolution spatiale des modèles (i.e. tailles des mailles), les conditions météorologiques, la localisation et l’intensité des émissions par les bâtiments d’élevage, ainsi que les occupations des sols des zones agricoles (e.g. parcelles cultivées) et semi-naturelles (e.g. forêts, prairies permanentes). Les résultats montrent que les dépôts moyens de NH3 simulés par chacun des deux modèles sont relativement similaires pour un scénario donné. En revanche, les différences de structure des deux modèles (i.e. hypothèses, formalismes), de résolution spatiale, de distribution spatiale des émissions et des occupations des sols ont généré des différences importantes dans les prédictions des concentrations et des dépôts spatialisés de NH3. Il en résulte des distributions spatiales des dépassements de charges critiques en NH3 très différentes entre les deux modèles. Ces résultats mettent en évidence de manière quantitative que les modèles régionaux utilisant des mailles de grande taille ne permettent pas de détecter les dépassements de charges critiques en NH3, en particulier dans les territoires avec des hot-spots d’émission de fortes intensités. Une des perspectives est d’intégrer les connaissances acquises avec les modèles fonctionnant à l’échelle locale dans les modèles régionau
    corecore